<template>
  <div id="app">
    <el-container>
      <el-header>
        <a href="https://github.com/xuliangzhan/vue-mock-template">查看代码</a>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            router
            :default-active="defaultActive"
            class="el-menu-vertical-demo">
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>用户信息</span>
              </template>
              <el-menu-item index="/userList">最新用户</el-menu-item>
              <el-menu-item index="/userPageList">用户管理</el-menu-item>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>角色信息</span>
              </template>
              <el-menu-item index="/roleList">最新角色</el-menu-item>
              <el-menu-item index="/rolePageList">角色管理</el-menu-item>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'app',
  data () {
    return {
      defaultActive: this.$route.path
    }
  }
}
</script>

<style>
#app {
  font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
</style>
